package org.collection.newcollection;

import com.google.common.collect.Range;
import com.google.common.collect.RangeSet;
import com.google.common.collect.TreeRangeSet;

public class RangSetTest {

	public static void main(String[] args) {
		RangeSet<Integer> rangeSet = TreeRangeSet.create();
		rangeSet.add(Range.closed(1,  10));
		System.out.println(rangeSet.toString());
		
		rangeSet.add(Range.closedOpen(11, 15));
		System.out.println(rangeSet.toString());
		
		rangeSet.add(Range.closedOpen(15, 20));
		System.out.println(rangeSet.toString());
		
		rangeSet.add(Range.openClosed(0, 0));
		System.out.println(rangeSet.toString());
		
		rangeSet.remove(Range.open(5, 10));
		System.out.println(rangeSet.toString());
	}
	
	
}
